<template>
  <view class="index-container">
    <CanvasPage :scroll-top="scrollTop" />
    <ADWindow />
    <ReturnTop :scroll-top="scrollTop" />
  </view>
</template>

<script setup>
import { onLoad, onPageScroll, onShareAppMessage, onShareTimeline } from '@dcloudio/uni-app'
import { useMainStore } from '@/store/modules/useMainStore'
import CanvasPage from '@/components/canvasShow/canvasShowPage.vue'
import ReturnTop from "@/components/ReturnTop/index.vue"
import ADWindow from "@/components/adWindow/adWindow.vue"
import { useScroll } from "@/hooks/useScroll";
import { useShare } from "@/hooks/useShare";

const main = useMainStore()

const {shareAppMessage, shareTimeline} = useShare();
onShareAppMessage(shareAppMessage)
onShareTimeline(shareTimeline)
const {scrollTop} = useScroll()

onPageScroll(() => {
})

onLoad(() => {
  main.init()
})

</script>

<style lang="scss">
.index-container {
  width: 100%;
  position: relative;
}
</style>
